import 'package:flutter_test/flutter_test.dart';
import 'package:lx_location_plugin/lx_location_plugin.dart';
import 'package:lx_location_plugin/lx_location_plugin_platform_interface.dart';
import 'package:lx_location_plugin/lx_location_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockLxLocationPluginPlatform
    with MockPlatformInterfaceMixin
    implements LxLocationPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<String?> startLocationService() => Future.value('Location Service Started');

  @override
  Future<String?> stopLocationService() => Future.value('Location Service Stopped');

  @override
  Stream<Map<String, dynamic>> get locationUpdates => const Stream.empty();

}

void main() {
  final LxLocationPluginPlatform initialPlatform = LxLocationPluginPlatform.instance;

  test('$MethodChannelLxLocationPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelLxLocationPlugin>());
  });

  test('getPlatformVersion', () async {
    LxLocationPlugin lxLocationPlugin = LxLocationPlugin();
    MockLxLocationPluginPlatform fakePlatform = MockLxLocationPluginPlatform();
    LxLocationPluginPlatform.instance = fakePlatform;

    expect(await lxLocationPlugin.getPlatformVersion(), '42');
  });
}
